<template>
  <basic-container>
    <section class="haruyuki-bg-color-white">
      <div class="haruyuki-flex-space-between haruyuki-align-items-center">
        <div class="haruyuki-title haruyuki-size-16">
          <i class="el-icon-tickets"></i><span class="haruyuki-ml-6">订单信息</span>
        </div>
      </div>
      <div class="haruyuki-content">
        <el-row :gutter="20">
          <el-col :span="8">
            <span class="wordBreak haruyuki-color-primaryblue">{{ tradeInfo.rpiName }}</span>
          </el-col>
          <el-col :span="8">
            <span class="wordBreak">商户分类：{{tradeInfo.merchantTypeName}}</span>
          </el-col>
          <el-col :span="8">
            <span class="wordBreak">商户类型：{{tradeInfo.merchantUserTypeName}}</span>
          </el-col>
          <el-col :span="8">
            <span class="wordBreak">商户编号：{{ tradeInfo.rpiNo }}</span>
          </el-col>
          <el-col :span="8">
            <span class="wordBreak">商户注册名称：<span class="haruyuki-color-primaryblue">{{tradeInfo.mercAbbr}}</span></span>
          </el-col>
          <el-col :span="8">
            <span class="wordBreak">门头名称： {{tradeInfo.rpiName}}</span>
          </el-col>
          <el-col :span="8">
            <span class="wordBreak">商户简称：<span class="haruyuki-color-primaryblue">{{tradeInfo.userShortName}}</span></span>
          </el-col>
          <el-col :span="8">
            <span class="wordBreak">门店名称：{{tradeInfo.rpsName}}</span>
          </el-col>
          <el-col :span="8">
            <span class="wordBreak">收银员编号：{{getRemark(tradeInfo.rpstNo)}}</span>
          </el-col>
          <el-col :span="8">
            <span class="wordBreak">收银员名称：{{getRemark(tradeInfo.rpstName)}}</span>
          </el-col>
          <el-col :span="8">
            <span class="wordBreak">机构编号：{{tradeInfo.orgNo}}</span>
          </el-col>
          <el-col :span="8">
            <span class="wordBreak">机构名称：{{tradeInfo.orgName}}</span>
          </el-col>
          <el-col :span="8">
            <span class="wordBreak">订单号：{{ tradeInfo.rptOrderCode }}</span>
          </el-col>
          <el-col :span="8">
            <span class="wordBreak">终端流水号：{{ tradeInfo.rptRtNo }}</span>
          </el-col>
          <el-col :span="8">
            <span class="wordBreak">官方订单号：{{getRemark(tradeInfo.rptOtherPayCode)}}</span>
          </el-col>
          <el-col :span="8">
            <span class="wordBreak">通道订单号：{{ tradeInfo.rptAisleOrderCode }}</span>
          </el-col>
          <el-col :span="8">
            <span class="wordBreak">交易SN号：{{ getRemark(payInfo.rsSn) }}</span>
          </el-col>
          <el-col :span="8">
            <span class="wordBreak">附加数据：{{ getRemark(tradeInfo.attach) }}</span>
          </el-col>
        </el-row>
      </div>
      <div class="haruyuki-title haruyuki-size-16">
        <i class="el-icon-postcard"></i><span class="haruyuki-ml-6">支付信息</span>
      </div>
      <div class="haruyuki-content" v-if="isPos != 1">
        <el-row :gutter="20">
          <el-col :span="8">
            <span class="wordBreak">订单金额：{{ exhibition(payInfo.rptAmount) }}元</span>
          </el-col>
          <el-col :span="8"></el-col>
          <el-col :span="8">
            <span class="wordBreak">支付状态：
              <span class="haruyuki-color-primaryblue">{{ payInfo.rptPayStateName }}</span>
              <span class="haruyuki-color-silverGray" v-show="exhibition(payInfo.rptIsRefund) != 0 && payInfo.rptPayStateName == '支付成功'" >(已退款)</span>
            </span>
          </el-col>
          <el-col :span="8">
            <span class="wordBreak">商户分类：{{tradeInfo.ysMerchantType}}/{{tradeInfo.industryName}}/{{tradeInfo.mccCdName}} </span>
          </el-col>
          <el-col :span="8">
            <span class="wordBreak">交易类型：{{payInfo.isPosName}}</span>
          </el-col>
        </el-row>
        <el-row :gutter="20">
          <el-col :span="8">
            <span class="wordBreak">订单类型：{{payInfo.rptTradeTypeName}}</span>
          </el-col>
          <el-col :span="8">
            <span class="wordBreak">支付方式：{{ payInfo.rpsCustTypeName }}</span>
          </el-col>
          <el-col :span="8">
            <span class="wordBreak">卡类型：{{ payInfo.cardTypeName }}</span>
          </el-col>
          <el-col :span="8">
            <span class="wordBreak">终端编号：{{ tradeInfo.rtNo }}</span>
          </el-col>
          <el-col :span="8">
            <span class="wordBreak">买家实付金额：{{ exhibition(payInfo.rptAmount) }} 元</span>
          </el-col>
          
          <el-col :span="8">
            <span class="wordBreak">交易手续费：{{ exhibition(payInfo.totalPayFee) }} 元</span>
          </el-col>
          <el-col :span="8">
            <span class="wordBreak">优惠交易手续费：{{exhibition(payInfo.preferentialFee)}} 元</span>
          </el-col>
          <el-col :span="8">
            <span class="wordBreak">实际交易手续费：{{exhibition(payInfo.rptFee)}} 元</span>
          </el-col>
          <el-col :span="8">
            <span class="wordBreak">垫资手续费：{{exhibition(payInfo.totalPayD0Fee)}} 元</span>
          </el-col>
          <el-col :span="8">
            <span class="wordBreak">优惠垫资手续费：{{exhibition(payInfo.preferentialFeeD0)}} 元</span>
          </el-col>
          <el-col :span="8">
            <span class="wordBreak">实际垫资手续费：{{exhibition(payInfo.rptFeeD0)}} 元</span>
          </el-col>
          <el-col :span="8">
            <span class="wordBreak">总手续费：{{exhibition(payInfo.totalFee)}} 元</span>
          </el-col>
          <el-col :span="8">
            <span class="wordBreak">商家优惠金额：{{exhibition(payInfo.preferentialAmount)}} 元</span>
          </el-col>
          <el-col :span="8">
            <span class="wordBreak">平台优惠金额：{{exhibition(payInfo.platformDiscountAmount)}} 元</span>
          </el-col>
          <el-col :span="8">
            <span class="wordBreak">通道优惠金额：{{exhibition(payInfo.aisleDiscountAmount)}} 元</span>
          </el-col>
          <el-col :span="8">
            <span class="wordBreak">结算金额：<span class="haruyuki-color-primaryblue">{{ exhibition(payInfo.rptActualAmount) }}</span> 元</span>
          </el-col>
          <el-col :span="8">
            <span class="wordBreak">通道名称：{{ payInfo.aisleName }}</span>
          </el-col>
          <el-col :span="8">
            <span class="wordBreak">用户身份标识：{{ payInfo.rpsCustId }}</span>
          </el-col>
          <el-col :span="8">
            <span class="wordBreak">结算方式：{{ payInfo.settlementMethod }}</span>
          </el-col>
          <el-col :span="8">
            <span class="wordBreak">分润类型：{{ payInfo.profitOrderTypeName }}</span>
          </el-col>
          <el-col :span="8">
            <span class="wordBreak">分润模式：{{payInfo.settlementModeName}}</span>
          </el-col>
          <el-col :span="8">
            <span class="wordBreak">机构交易分润：{{exhibition(payInfo.profitAmount)}} 元</span>
          </el-col>
          <el-col :span="8">
            <span class="wordBreak">机构垫资分润：{{exhibition(payInfo.profitAmountD0)}} 元</span>
          </el-col>
          <el-col :span="8">
            <span class="wordBreak">机构总分润金额：{{exhibition(payInfo.totalProfitAmount)}} 元</span>
          </el-col>
          <el-col :span="8">
            <span class="wordBreak">本级交易收益：{{exhibition(payInfo.selfProfitAmount)}} 元</span>
          </el-col>
          <el-col :span="8">
            <span class="wordBreak">本级垫资收益：{{exhibition(payInfo.selfProfitAmountD0)}} 元</span>
          </el-col>
          <el-col :span="8">
            <span class="wordBreak">本级总收益：{{exhibition(payInfo.selfTotalProfitAmount)}} 元</span>
          </el-col>
        </el-row>
      </div>
      <div class="haruyuki-content" v-if="isPos == 1">
        <el-row :gutter="20">
          <el-col :span="8">
            <span class="wordBreak">订单金额：{{ exhibition(payInfo.rptAmount) }}元</span>
          </el-col>
          <el-col :span="8"></el-col>
          <el-col :span="8">
            <span class="wordBreak">支付状态：
              <span class="haruyuki-color-primaryblue">{{ payInfo.rptPayStateName }}</span>
              <span class="haruyuki-color-silverGray" v-show="exhibition(payInfo.rptIsRefund) != 0 && payInfo.rptPayStateName == '支付成功'" >(已退款)</span>
            </span>
          </el-col>
          <el-col :span="8">
            <span class="wordBreak">订单类型：{{payInfo.rptTradeTypeName}}</span>
          </el-col>
          <el-col :span="8">
            <span class="wordBreak">支付方式：{{ payInfo.rpsCustTypeName }}</span>
          </el-col>
          <el-col :span="8">
            <span class="wordBreak">卡类型：{{ payInfo.cardTypeName }}</span>
          </el-col>
          <el-col :span="8">
            <span class="wordBreak">终端编号：{{ tradeInfo.rtNo }}</span>
          </el-col>
          <el-col :span="8">
            <span class="wordBreak">买家实付金额：{{ exhibition(payInfo.rptAmount) }} 元</span>
          </el-col>
          <el-col :span="8">
            <span class="wordBreak">交易手续费：{{ exhibition(payInfo.totalPayFee) }} 元</span>
          </el-col>
          <el-col :span="8">
            <span class="wordBreak">垫资手续费：{{exhibition(payInfo.totalPayD0Fee)}} 元</span>
          </el-col>
          <el-col :span="8">
            <span class="wordBreak">提现手续费：{{exhibition(additionPosInfo.withdrawalFee)}} 元</span>
          </el-col>
          <el-col :span="8">
            <span class="wordBreak">增收手续费：{{exhibition(additionPosInfo.raiseFee)}} 元</span>
          </el-col>
          <el-col :span="8">
            <span class="wordBreak">夜间手续费：{{exhibition(additionPosInfo.nightFee)}} 元</span>
          </el-col>
          <el-col :span="8">
            <span class="wordBreak">特殊手续费：{{exhibition(additionPosInfo.specialFee)}} 元</span>
          </el-col>
          <el-col :span="8">
            <span class="wordBreak">增值手续费：{{exhibition(additionPosInfo.addedFee)}} 元</span>
          </el-col>
          <el-col :span="8">
            <span class="wordBreak">商户管理费：{{exhibition(additionPosInfo.merchantFee)}} 元</span>
          </el-col>
         <el-col :span="8">
            <span class="wordBreak">VIP增收费：{{exhibition(additionPosInfo.vipFee)}} 元</span>
          </el-col>
          <el-col :span="8">
            <span class="wordBreak">设备服务费：{{exhibition(additionPosInfo.equipmentFee)}} 元</span>
          </el-col>
          <el-col :span="8">
            <span class="wordBreak">平台优惠金额：{{exhibition(payInfo.platformDiscountAmount)}} 元</span>
          </el-col>
          <el-col :span="8">
            <span class="wordBreak">通道优惠金额：{{exhibition(payInfo.aisleDiscountAmount)}} 元</span>
          </el-col>
          <el-col :span="8">
            <span class="wordBreak">物联网管理费：{{exhibition(additionPosInfo.internetFee)}} 元</span>
          </el-col>
          <el-col :span="8">
            <span class="wordBreak">总手续费：{{exhibition(payInfo.totalFee)}} 元</span>
          </el-col>
          <el-col :span="8">
            <span class="wordBreak">商户实收金额：{{exhibition(additionPosInfo.merInAmt)}} 元</span>
          </el-col>
          <el-col :span="8">
            <span class="wordBreak">通道名称：{{ payInfo.aisleName }}</span>
          </el-col>
          <el-col :span="8">
            <span class="wordBreak">结算状态：{{getRemark(payInfo.settlementStateName)}}</span>
          </el-col>
          <el-col :span="8">
            <span class="wordBreak">交易卡号：{{getRemark(additionPosInfo.cardNumber)}}</span>
          </el-col>
          <el-col :span="8">
            <span class="wordBreak">分润类型：{{ payInfo.profitOrderTypeName }}</span>
          </el-col>
          <el-col :span="8">
            <span class="wordBreak">分润模式：{{payInfo.settlementModeName}}</span>
          </el-col>
          <el-col :span="8">
            <span class="wordBreak">机构交易分润：{{exhibition(payInfo.profitAmount)}} 元</span>
          </el-col>
          <el-col :span="8">
            <span class="wordBreak">机构垫资分润：{{exhibition(payInfo.profitAmountD0) }} 元</span>
          </el-col>
          <el-col :span="8">
            <span class="wordBreak">机构总分润金额：{{exhibition(payInfo.totalProfitAmount)}}元</span>
          </el-col>
          <el-col :span="8">
            <span class="wordBreak">本级交易收益：{{exhibition(payInfo.selfProfitAmount)}}元</span>
          </el-col>
          <el-col :span="8">
            <span class="wordBreak">本级垫资收益：{{exhibition(payInfo.selfProfitAmountD0)}} 元</span>
          </el-col>
          <el-col :span="8">
            <span class="wordBreak">本级总收益：{{exhibition(payInfo.selfTotalProfitAmount)}} 元</span>
          </el-col>
           <el-col :span="8">
            <span class="wordBreak">用户身份标识：{{ getRemark(payInfo.rpsCustId) }}</span>
          </el-col>
          <el-col :span="8">
            <span class="wordBreak">交易类型：{{payInfo.isPosName}}</span>
          </el-col>
        </el-row>
      </div>
      <div class="haruyuki-title haruyuki-size-16">
        <i class="el-icon-time"></i><span class="haruyuki-ml-6">时间信息</span>
      </div>
      <div class="haruyuki-content">
        <el-row :gutter="20">
          <el-col :span="8">
            <span class="wordBreak">终端交易时间：{{ dateInfo.rptPayTime }}</span>
          </el-col>
          <el-col :span="8">
            <span class="wordBreak">订单创建时间：{{ dateInfo.createTime }}</span>
          </el-col>
          <el-col :span="8">
            <span class="wordBreak">支付完成时间：{{ dateInfo.rptPayTrueTime }}</span>
          </el-col>
          <el-col :span="8">
            <span class="wordBreak">结算处理时间：{{ dateInfo.settlementDealTime }}</span>
          </el-col>
          <el-col :span="8">
            <span class="wordBreak">交易信息推送状态： {{getRemark(dateInfo.pushStatusName)}}</span>
          </el-col>
        </el-row>
      </div>
      <div class="haruyuki-title haruyuki-size-16 dg-wrap dg-line">
         <i class="el-icon-edit"></i><span class="haruyuki-ml-6">备注信息</span>
      </div>
      <div class="haruyuki-content">
        <div>{{tradeInfo.remark||getRemark(tradeInfo.remark)}}</div>
      </div>
      <!-- <div v-show='payInfo.rptPayState > 3'>
        <div class="haruyuki-title haruyuki-size-16 dg-wrap dg-line">
          <i class="el-icon-tickets"></i><span class="haruyuki-ml-6">原始交易</span>
        </div>
        <div class="haruyuki-content">
          <el-row :gutter="20">
            <el-col :span="8">
              <span class="wordBreak">订单号：{{ originTradeInfo.rptOrderCode }}</span>
            </el-col>
             <el-col :span="8">
              <span class="wordBreak">通道订单号：{{ originTradeInfo.rptAisleOrderCode }}</span>
            </el-col>
            <el-col :span="8">
              <span class="wordBreak">流水号：{{ originTradeInfo.rptRtNo }}</span>
            </el-col>
            <el-col :span="8">
              <span class="wordBreak">交易时间：{{ originTradeInfo.rptPayTime }}</span>
            </el-col>
            <el-col :span="8">
              <span class="wordBreak">商户编号：{{ originTradeInfo.rpiNo }}</span>
            </el-col>
            
            <el-col :span="8">
              <span class="wordBreak">门店名称： {{originTradeInfo.rpsName}}</span>
            </el-col>
            <el-col :span="8">
              <span class="wordBreak">支付方式： {{originTradeInfo.rpsCustTypeName}}</span>
            </el-col>
            <el-col :span="8">
              <span class="wordBreak">交易状态： <span class="haruyuki-color-primaryblue" >{{originTradeInfo.rptPayStateName}}</span></span>
            </el-col>
          </el-row>
        </div>
      </div>
      <div v-show='payInfo.rptPayState > 3||refundType(payInfo.rptPayStateName, payInfo.rptIsRefund)'>
        <div class="haruyuki-title haruyuki-size-16 dg-wrap dg-line">
          <i class="el-icon-tickets"></i><span class="haruyuki-ml-6">已退款交易</span>
        </div>
        <div class="haruyuki-content">
          <el-row :gutter="20">
            <avue-crud
              :option="option"
              :data="refundList"
              ref="crud"
              @current-change="currentChange"
              @size-change="sizeChange"
              @refresh-change="refreshChange"
            >
              <template slot-scope="{row}" slot="rptPayStateName">
                <div>
                  <el-tag type="success" :color="rptPayStateType(row)" effect="dark">{{row.rptPayStateName}}</el-tag>
                </div>
              </template>
            </avue-crud>
          </el-row>
        </div>
      </div> -->
    </section>
    <!-- <el-dialog
      title="退款"
      append-to-body
      :close-on-click-modal="false"
      :visible.sync="dialogRefundVisible"
    >
      <avue-form ref="serveForm" :option="refundOption" v-model="refundForm" @submit="refundSubmit"></avue-form>
    </el-dialog> -->
    <!-- 二级密码 -->
    <!-- <el-dialog
      title="二级密码"
      append-to-body
      width="440px"
      :close-on-click-modal="false"
      v-if="twoPwdShow"
      :visible.sync="twoPwdShow"
      :before-close="handleCloseTwoPwd"
    >
      <el-form :model="towPwdForm" ref="towPwdForm" label-width="0" class="demo-ruleForm">
        <el-form-item
          label=""
          prop="towPwd"
          :rules="[
            { required: true,message: '二级密码不能为空', trigger: ['blur','change']},
            { pattern: /^[0-9]{6}$/, message: '二级密码由6位数字组成', trigger: ['blur','change']}
          ]"
          >
          <el-input show-password v-model.number="towPwdForm.towPwd" autocomplete="off" placeholder="输入二级密码"></el-input>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="twoPwdSubmit()">确 定</el-button>
      </div>
    </el-dialog> -->
  </basic-container>
</template>
<script>
import { getInfoDetails } from "@/api/rb-oem/childOemProfit/service_profit";
import { refundOrder } from "@/api/rb-oem/dealManagement/dealManagement";
import { userHasInfo } from "@/api/rb-oem/forgetPassword/forgetPassword";
import md5 from 'js-md5';

export default {
  data() {
    return {
      rptAisleOrderCode: "",
      tradeInfo: {}, //交易信息
      payInfo: {}, //支付信息
      dateInfo: {}, //支付时间
      refundList: [], //退款记录
      originTradeInfo:{},//原始交易记录
      dialogRefundVisible: false, //退款 dialog
      refundOn: false,
      available: 0,
      option: {
        // height: "calc(50vh - 50px)",
        calcHeight: 30,
        tip: false,
        border: true,
        index: true,
        viewBtn: false,
        editBtn: false,
        addBtn: false,
        delBtn: false,
        searchMenuSpan: 24,
        columnBtn: false,
        menu:false,
        refreshBtn:false,
        searchBtn:false,
        selectClearBtn:false,
        indexLabel:'序号',
        selection:false,
        column: [
           {
            label: "退款订单号",
            prop: "refundOrderCode",
            type: "input",
            overHidden:true,
            minWidth: 250
          },
          
          {
            label: "商户编号",
            prop: "rpiNo",
            type: "input",
            overHidden:true,
            minWidth: 130
          },
          {
            label: "门头名称",
            prop: "rpiName",
            type: "input",
            width: 200
          },
          {
            label: "门店名称",
            prop: "rpsName",
            type: "input",
            minWidth: 180,
            overHidden:true,
          },
           {
            label: "退款金额",
            prop: "rptRefundAmount",
            type: "input",
            minWidth: 150,
            overHidden:true,
          },
           {
            label: "退款时间",
            prop: "rptPayTrueTime",
            type: "input",
            minWidth: 150,
            overHidden:true,
          },
           {
            label: "支付方式",
            prop: "rpsCustTypeName",
            type: "input",
            overHidden:true,
            minWidth: 100,
          },
           {
            label: "退款状态",
            prop: "rptPayStateName",
            type: "input",
            overHidden:true,
            minWidth: 100,
          },
          {
            label: "通道订单号",
            prop: "rptAisleOrderCode",
            type: "input",
            overHidden:true,
            minWidth: 150
          },
           {
            label: "流水号",
            prop: "rptRtNo",
            type: "input",
            overHidden:true,
            minWidth: 220
          },
          {
            label: "备注",
            prop: "remark",
            type: "input",
            overHidden: true
          }
        ]
      },
      refundForm: {},
      refundOption: {
        calcHeight: 30,
        tip: false,
        border: true,
        index: true,
        refreshBtn:false,
        column: [
           {
            label: "退款金额",
            prop: "refundAmount",
            type: "number",
            value: null,
            maxRows: "",
            minRows: "0",
            step: "1",
            precision: "2",
            dataType: 'number',
            rules: [
              {
                required: true,
                message: "请输入退款金额",
                trigger: "blur",
              },
            ],
          },
          {
            label: "退款理由",
            prop: "refundReason",
            type: "textarea",
            span: 24,
            minRows: 2,
            rules: [
              {
                required: true,
                message: "请输入退款理由",
                trigger: "blur",
              },
            ],
          },
        ]
      },
      hasPayPwd:false,
      twoPwdShow:false,
      towPwdForm:{
        towPwd:''
      },
      isNotify:false,
      isPos:null,
      additionPosInfo:{}
    };
  },
  computed: {
    setIsYN() {
      return (val) => {
        if (val == "Y") {
          return '是';
        } else {
          return '否';
        }
      };
    },
    exhibition() {
      return (val) => {
        if (val == "" || val == undefined) {
          return (val = 0);
        } else {
          return val;
        }
      };
    },
    formatVal() {
      return (val) => {
        if (val) {
          return val;
        } else {
          return "";
        }
      };
    },
    // 交易状态
    rptPayStateType() {
      return (row) => {
        if(row.rptPayState==0){
          return '#E6A23C' //未支付
        }else if(row.rptPayState==1&&row.rptIsRefund!==0){
          return '#6463bf' //支付成功（已退款）
        }else if(row.rptPayState==1){
          return '#67C23A' //支付成功
        }else if(row.rptPayState==2){
          return '#909399'    //支付失败
        }else if(row.rptPayState==3){
          return '#909399' //取消支付
        }else if(row.rptPayState==4){
          return '#909399' //退款中
        }else if(row.rptPayState==5){
          return '#2fdeebf2' //已退款
        }else if(row.rptPayState==6){
          return '#909399' //退款失败
        }else{
          return '#909399' 
        }
      }
    },
    // 备注
    getRemark(){
      return (val) => {
        if (val) {
          return val;
        } else {
          return "无";
        }
      };
    }
  },
  created() {
    this.infoData();
  },
  methods: {
    // 二级密码 关闭回调
    handleCloseTwoPwd(done){
      this.towPwdForm.towPwd="";
      done()
    },
    // 二级密码 确定
    twoPwdSubmit(){
      let _that = this;
      this.$refs.towPwdForm.validate((valid) => {
        if (valid) {
          refundOrder({orderCode:_that.tradeInfo.rptOrderCode, ..._that.refundForm,payPwd:md5(_that.towPwdForm.towPwd+'')}).then(() => {
            _that.twoPwdShow = false;
            _that.towPwdForm.towPwd="";
            _that.dialogRefundVisible = false;
            _that.$message({
              type: "success",
              message: "退款成功!"
            });
            _that.$refs.serveForm.resetForm();
            _that.infoData();
          },(error) => {
            window.console.log(error);
          });
        } else {
          return false;
         }
      });
    },
    /* 退款 dialog */
    getRefund() {
      const column = this.findObject(this.refundOption.column, "refundAmount");
      column.value = this.available;
      column.maxRows = this.available;
      this.dialogRefundVisible = true;
    },
    /* 提交 退款金额 */
    refundSubmit(row, done) {
      if(this.hasPayPwd){
        this.twoPwdShow=true;
        done();
      } else {
        this.$confirm('请您先设置二级密码，再操作！', '提示', {
          confirmButtonText: '确定',
          showCancelButton:false,
          type: 'warning'
        }).then(() => {
          this.$router.push({ path: '/info/index', query: { index: 2 }})
        })
      }
      
    },
    /**
     * 显示退款信息
     * rptIsRefund 是否有退款（0否1部分退款2全部退款
     */
    refundType(rptPayStateName, rptIsRefund) {
      if (rptPayStateName == "退款失败" || rptPayStateName == "已退款" || (rptPayStateName == "支付成功"&&this.exhibition(rptIsRefund) != 0)) {
        return true;
      } else {
        return false;
      }
    },
    /* 页面加载 初始化请求详情接口 */
    infoData() {
      // const id = this.$route.query.id;
      // this.id = id;
      this.rptAisleOrderCode = this.$route.query.rptAisleOrderCode;
      let param = this.$route.query
      // {
      //   rptAisleOrderCode:this.rptAisleOrderCode,
      //   serviceNo:this.$route.query.serviceNo
      // }
        getInfoDetails(param).then((res) => {
          this.dateInfo = res.data.data.dateInfo;
          this.payInfo = res.data.data.payInfo;
          this.refundList = res.data.data.refundList;
          this.tradeInfo = res.data.data.tradeInfo;
          this.refundOn = res.data.data.refundOn;
          this.available = res.data.data.available;
          this.originTradeInfo = res.data.data.originTradeInfo;
          this.isNotify = res.data.data.isNotify;//补发第三方通知按钮权限
          this.isPos = res.data.data.isPos;
          this.additionPosInfo = res.data.data.additionPosInfo;
        });

      userHasInfo().then(res =>{
        this.hasPayPwd = res.data.data.hasPayPwd;
      }, error => {
        window.console.log(error);
      })
    },
    /* 返回页面 */
    goBack() {
      this.$router.$avueRouter.closeTag();
      this.$router.replace({ path: "/rb-oem/oemprofit/pos_profit" });
    }
  }
};
</script>

<style lang="scss" scoped>
.picture-preview {
  color: #409eff;
  cursor: pointer;
}

.merchant-title {
  font-weight: bold;
}
.img-margin-r10 {
  margin-right: 10px;
}
/deep/ .avue-crud__menu{
  display: none !important;
}
.wordBreak{
  word-break: break-word;
}
/deep/ .el-tag--dark.el-tag--success {
  border: none !important;
}
</style>